#ifndef LIST_H
#define LIST_H

#include "Core/Common.h"

typedef struct ListNode {
    void *data;
    struct ListNode *next;
} ListNode;

typedef struct {
    ListNode *head;
    ListNode *tail;
    size_t size;
} LinkedList;

typedef ListNode* ListIterator;

LinkedList* list_create();

void list_destroy(LinkedList** list, void(*free_data)(void*));

ErrorCode list_add(LinkedList* list, void* data);

ListIterator list_begin(LinkedList* list);

ListIterator list_next(ListIterator it);

#endif // LIST_H

